<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta charset="UTF-8" />
        <title>PKL 54 | Baca_detail</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">
        <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
        <link rel="icon" type="image/icon" href="images/logo/home.png">

        <!--nyoba pasang-->
        <link rel='stylesheet' id='main-css'  href='css/header.css' type='text/css' media='all' />
        <link rel='stylesheet' id='montserrat-css'  href='//fonts.googleapis.com/css?family=Montserrat%3A400%2C700%7COpen+Sans%3A300%2C400%2C700&#038;ver=4.1' type='text/css' media='' />
        <script type='text/javascript' src='http://www.mageewp.com/meris/wp-includes/js/jquery/jquery.js?ver=1.11.1'></script>
        <!--tututp-->

        <link rel="stylesheet" href="css/bootstrap.css">
        <link rel="stylesheet" href="css/font-awesome.css">
        <link rel="stylesheet" href="css/templatemo_style.css">
        <link rel="stylesheet" href="css/templatemo_misc.css">
        <link rel="stylesheet" href="css/flexslider.css">
        <link rel="stylesheet" href="css/testimonails-slider.css">
        <script src="js/vendor/modernizr-2.6.1-respond-1.1.0.min.js"></script>
        <script type='text/javascript'>
            /* <![CDATA[ */
            var meris_js_var = {"global_color": "#FED136"};
            /* ]]> */
        </script>
        <script type='text/javascript' src='js/less.min.js'></script>
        <script type='text/javascript' src='http://www.mageewp.com/meris/wp-content/themes/meris/js/respond.min.js?ver=1.4.2'></script>

    </script>
    <script type='text/javascript' src='http://www.mageewp.com/meris/wp-content/themes/meris/js/meris.js?ver=1.0.4'></script>
    <meta name="generator" content="WordPress 4.1" />
    <script type="text/javascript">
            jQuery(document).ready(function() {
// CUSTOM AJAX CONTENT LOADING FUNCTION
                var ajaxRevslider = function(obj) {

// obj.type : Post Type
// obj.id : ID of Content to Load
// obj.aspectratio : The Aspect Ratio of the Container / Media
// obj.selector : The Container Selector where the Content of Ajax will be injected. It is done via the Essential Grid on Return of Content

                    var content = "";

                    data = {};

                    data.action = 'revslider_ajax_call_front';
                    data.client_action = 'get_slider_html';
                    data.token = '07773db7dc';
                    data.type = obj.type;
                    data.id = obj.id;
                    data.aspectratio = obj.aspectratio;

// SYNC AJAX REQUEST
                    jQuery.ajax({
                        type: "post",
                        url: "http://www.mageewp.com/meris/wp-admin/admin-ajax.php",
                        dataType: 'json',
                        data: data,
                        async: false,
                        success: function(ret, textStatus, XMLHttpRequest) {
                            if (ret.success == true)
                                content = ret.data;
                        },
                        error: function(e) {
                            console.log(e);
                        }
                    });

// FIRST RETURN THE CONTENT WHEN IT IS LOADED !!
                    return content;
                };

// CUSTOM AJAX FUNCTION TO REMOVE THE SLIDER
                var ajaxRemoveRevslider = function(obj) {
                    return jQuery(obj.selector + " .rev_slider").revkill();
                };

// EXTEND THE AJAX CONTENT LOADING TYPES WITH TYPE AND FUNCTION
                var extendessential = setInterval(function() {
                    if (jQuery.fn.tpessential != undefined) {
                        clearInterval(extendessential);
                        if (typeof (jQuery.fn.tpessential.defaults) !== 'undefined') {
                            jQuery.fn.tpessential.defaults.ajaxTypes.push({type: "revslider", func: ajaxRevslider, killfunc: ajaxRemoveRevslider, openAnimationSpeed: 0.3});
                            // type:  Name of the Post to load via Ajax into the Essential Grid Ajax Container

                        }
                    }
                }, 30);
            });
    </script>
    <meta name="generator" content="WordPress 4.1" />
</head>
<body>
    <!--Header-->
    <?php include 'header.php'; ?>

    <div id="product-post">
        <div class="container">
            <div class="row">
                <div class="">
                    <div class="heading-section">                       

                        <?php
                        $id = $_GET['id'];
                        include 'koneksiDB.php';
                        $kat = 'SELECT kategori FROM kategori_artikel WHERE kode=(SELECT kode FROM artikel WHERE id=' . $id . ')';
                        $hasil = $conn->query($kat);
                        if ($hasil)
                            while ($rowe = $hasil->fetch_assoc()) {
                                echo '<h2>' . $rowe['kategori'] . '</h2>';
                                echo '<img src="images/under-heading.png" />';
                            }
                        $quey = 'SELECT * From artikel WHERE id=' . $id;
                        $result = $conn->query($quey);
                        if ($result->num_rows > 0) {
                            // output data of each row
                            while ($row = $result->fetch_assoc()) {
                                echo "<img src=images/" . $row['fotoUtama'] . ">";
                                ?>
                            </div>;
                        </div>;
                    </div>;
                    <div id='contact-us'>;
                        <div class='container'>
                            <div class='row'>
                                <div class='product-item'>
                                    <div class='row'>
                                        <div class='col-md-10'>  
                                            <div class='heading-content'>
                                                <?php echo "<h2>" . $row['judul'] . "</h2>"; ?>
        <?php echo "<i>" . $row['tanggalPost'] . "</i>"; ?>
                                            </div>
                                            <div class='content'>
                                                <pre>
                        <?php echo $row['isi'];
                                                }
                                            }
                                            ?>
                                        </pre>
                                    </div>    
                                </div>


                                <div class="col-md-2">
                                    <div class="info">
                                        <p><h3>Daftar isi/ arsip</h3></p>
                                        <ul style="width:350px">
                                            <?php
                                            $query5 = 'SELECT judul,id From artikel WHERE kode=(SELECT kode FROM artikel WHERE id=' . $id . ')ORDER BY tanggalPost desc limit 10';
                                            $result15 = $conn->query($query5);
                                            if ($result15->num_rows > 0) {
                                                // output data of each row
                                                while ($row0 = $result15->fetch_array()) {
                                                    echo "<li style='float:none'><i class='fa fa-square'></i><a href='detail.php?id=" . $row0["id"] . "'><b>" . $row0['judul'] . "</b></a></li>";
                                                }
                                            }
                                            //$conn->close();
                                            ?>      
                                        </ul>
                                    </div>
                                </div>


                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>

    <div class="footerUp">
        <div class="container">

            <div class="main-footer">
                <div class="row">
                    <div class="col-md-4">
                        <div class="artikel-terbaru">
                            <h4 class="footer-title">BERITA TERKINI</h4>
                            <div class="berita">
                                <?php
                                include "artikel-function.php";
                                $quer = 'SELECT * FROM artikel WHERE kode=1 ORDER BY tanggalPost desc limit 1';
                                //$run = mysql_db_query($conn,$query);
                                $result1 = $conn->query($quer);
                                if ($result1->num_rows > 0) {
                                    // output data of each row
                                    while ($rows = $result1->fetch_assoc()) {
                                        echo"<center><img src=images/" . $rows['fotoUtama'] . " width='350px'></center>";
                                        echo "</div>";
                                        echo "<h3>" . $rows["judul"] . "</h3>";
                                        echo "tanggal post: " . $rows["tanggalPost"] . "<br>";
                                        cuplikArtikel($rows["isi"]);
                                        echo "<a href='detail.php?id=" . $rows["id"] . "'>Selengkapnya...</a>";
                                    }
                                } else {
                                    echo "0 results";
                                }
                                ?>
                            </div>
                        </div>



                        <div class="col-md-4">
                            <div class="artikel-terbaru">
                                <h4 class="footer-title">ARTIKEL TERBARU</h4>
                                <div class="berita">
                                    <?php
                                    $query = 'SELECT * FROM artikel WHERE kode=0 ORDER BY tanggalPost desc limit 1';
                                    //$run = mysql_db_query($conn,$query);
                                    $result = $conn->query($query);
                                    if ($result->num_rows > 0) {
                                        // output data of each row
                                        while ($row = $result->fetch_assoc()) {
                                            echo"<center><img src=images/" . $row['fotoUtama'] . " width='350px'></center>";
                                            echo "</div>";
                                            echo "<h3>" . $row["judul"] . "</h3>";
                                            echo "tanggal post: " . $row["tanggalPost"] . "<br>";
                                            cuplikArtikel($row["isi"]);
                                            echo "<a  href='detail.php?id=" . $row["id"] . "'>Selengkapnya...</a>";
                                        }
                                    } else {
                                        echo "0 results";
                                    }
                                    $conn->close();
                                    ?>
                                </div>
                            </div>
                            <div class="col-md-4">
                                <div class="tanya-jawab">
                                    <h4 class="footer-title">TWEETS</h4>
                                    <a class="twitter-timeline"  width="375px" height="255px" href="https://twitter.com/STIS54" data-widget-id="559667614796890112">Tweets by @STIS54</a>
                                    <script>!function(d, s, id) {
                                            var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';
                                            if (!d.getElementById(id)) {
                                                js = d.createElement(s);
                                                js.id = id;
                                                js.src = p + "://platform.twitter.com/widgets.js";
                                                fjs.parentNode.insertBefore(js, fjs);
                                            }
                                        }(document, "script", "twitter-wjs");</script>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div> 

<?php include 'footer.php'; ?>

            </body>
            </html>